package org.weed.gadgets;

import java.awt.AWTException;
import java.awt.MouseInfo;
import java.awt.Point;
import java.awt.Robot;
import java.awt.event.InputEvent;

public class MouseClicker {
	public static void main(String[] args) throws AWTException, InterruptedException {
		Robot robot = new Robot();
		int offset = 20;
		int count = 0;
		while (true) {
			count++;
			Point p = MouseInfo.getPointerInfo().getLocation();
			int x = p.x;
			int y = p.y;
			robot.mouseMove(x, y + offset);
			if (count == 6) {
				count = 0;
				offset *= -1;
			}
			robot.mousePress(InputEvent.BUTTON1_MASK);
			robot.mouseRelease(InputEvent.BUTTON1_MASK);
			Thread.sleep(100);
		}
	}
}
